package com.tan.lbs.activity;

import com.tan.lbs.activity.R;
import com.tan.lbs.dao.GameDAO;
import com.tan.lbs.dao.impl.GameDAOImpl;
import com.tan.lbs.util.Constants;
import com.tan.lbs.util.ResourceReader;
import com.tan.lbs.util.URLs;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

public class GameIntroActivity extends Activity{
	@Override
	public void onCreate(Bundle savedInstanceState) {

		super.onCreate(savedInstanceState);
		setContentView(R.layout.gameintro);
		
		Intent intent = getIntent();
		String introStr = intent.getStringExtra("intro");
		if(introStr == null) {
			GameDAO gameDAO = new GameDAOImpl(this);
			introStr  = gameDAO.readGameDetail(getSharedPreferences(Constants.PREFS_NAME, 0).getString("currentGameID", "")).getIntroduction();
		}
		((TextView)findViewById(R.id.introText)).setText(introStr);
		((Button)findViewById(R.id.introBackGameBtn)).setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				Intent intent = new Intent();
				intent.setClass(GameIntroActivity.this, MainPlayTabsHostActivity.class);
				GameIntroActivity.this.startActivity(intent);
			}
			
		});
	}
}
